{include file="public/header" /}

<div class="container mtb-15">
	<div class="col-md-9 left-box">
		<ul class="label-list">
			<a href="{:url('Question/index')}"><li class="{$category_id ? '' : 'on'}">全部</li></a>
			{volist name="category_list" id="rs"}
				<a href="{:url('Question/index')}?category_id={$rs['category_id']}"><li class="{$category_id == $rs['category_id'] ? 'on' : ''}">{$rs['title']}</li></a>
			{/volist}
		</ul>
		<div class="list-box mt-15">
			<div class="list-head">
				<ul class="tab-switch">
					<a href="{:url('Question/index')}?{:http_build_query(array_merge($qwhere))}"><li class="{$is_default ? 'on' : ''}">最新</li></a>
					<a href="{:url('Question/index')}?{:http_build_query(array_merge($qwhere, ['is_hot' => 1]))}"><li class="{$is_hot ? 'on' : ''}">热门</li></a>
					<a href="{:url('Question/index')}?{:http_build_query(array_merge($qwhere, ['unanswer' => 1]))}"><li class="{$unanswer ? 'on' : ''}">未回答</li></a>
				</ul>
			</div>
			<div class="list-body">
				{volist name="list" id="rs"}
					<div class="list-item">
						<div class="data-item" style="width: 80px;">
							<div class="user-head">
								{eq name="rs.is_anonymous" value="0"}
									<a href="{:url('People/index', array('user_id' => $rs['user_id']))}"><img src="{:img($rs['user_head_url'], 200, 200)}" alt=""></a>
								{else/}
									<img src="{:img($rs['user_head_url'], 200, 200)}" alt="">
								{/eq}
							</div>
							<div class="user-name">
								{eq name="rs.is_anonymous" value="0"}
									<a href="{:url('People/index', array('user_id' => $rs['user_id']))}">{$rs['user_name']}</a>
								{else/}
									匿名
								{/eq}
							</div>
						</div>
						<div class="data-item">
							<div class="title">
								{gt name="rs.reward" value="0"}
									<i class="icon-reward">{$rs['reward']}</i>
								{/gt}
								<a href="{:url('Question/detail', array('ask_id' => $rs['ask_id']))}">{$rs['title']}</a>
							</div>
							<div class="ask-content">
								{:str_cut(strip_tags($rs['content']), 300)}
								{notempty name="rs.best_info"}
									<div class="ask-anwser">最佳答案：{:str_cut(strip_tags($rs['best_info']['content']), 300)}</div>
								{/notempty}
							</div>
							<div class="opt-item">
								<span class="view-num">{$rs['view_num']}浏览</span>
								<span class="time">{$rs['time_ago_desc']}</span>
							</div>
						</div>
						<div class="data-item" style="width: 100px;">
							<a href="{:url('Question/detail', array('ask_id' => $rs['ask_id']))}#answer-form">
								<div class="answer-num">
									<div class="val">{$rs['answer_num']}</div>
									<div class="name">回答</div>
								</div>
							</a>
						</div>
					</div>
				{/volist}
			</div>
		</div>
		{$page}
	</div>
	<div class="col-md-3 right-box">
		<div class="question-btn">
			<a href="{:url('Question/submit')}" class="btn btn-block">我要提问</a>
		</div>

		<div class="active-user-box">
			<div class="title">最活跃用户</div>
			{volist name="user_active_list" id="rs"}
				<a href="{:url('People/index', array('user_id' => $rs['user_id']))}">
					<div class="user-item">
						<div class="head">
							<img src="{:img($rs['user_head_url'], 100, 100)}" alt="">
						</div>
						<div class="user-info">
							<div class="name">{$rs['user_name']}</div>
							<div class="info">
								<span>提问 {$rs['question_num']}</span>
								<span>回答 {$rs['answer_num']}</span>
							</div>
						</div>
					</div>
				</a>
			{/volist}
		</div>
	</div>
</div>


{include file="public/footer" /}